package com.practice;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServlet;

public class user extends HttpServlet{

        public void service(ServletRequest request, ServletResponse response) 
        		throws ServletException,java.io.IOException
        {
        	String userid = request.getParameter("userID");  
            String username = userName(userid);
        	request.setAttribute(username, response);
        }
        
        public String userName(String userid){
        	String username="";
        	Map<String,String> map = new HashMap<String,String>();
        	map.put("1","Qcheng"); 
        	map.put("2", "Yongjz");
        	username = map.get(userid);
        	return username;
        }
        
        
}
